<html>
	<head>
        <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.7/dijit/themes/tundra/tundra.css" />
        <script type="text/javascript">
            var dojoConfig = {
                parseOnLoad: true,
                isDebug: true,
                locale: 'ru-ru',
            };
        </script>
        <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.7/dojo/dojo.js"></script>

        <script type="text/javascript">
            dojo.ready(function() {
                require(['dojo/_base/xhr'], function(xhr) {
                    xhr.get({
                        url      : '/json.php',
                        handleAs : 'json',
                        load     : function(data){
                            console.log(data);
                            for(var i in data){
                               console.log('key', i, 'value', data[i]);
                            }
                        },
                        error : function(err, ioArgs){
                           console.error(err); // display the error
                       }
                    });
                });


                var xhrArgs = {
                    url          : '/json.php',
                    handleAs     : 'text',
                    preventCache : true,
                    content      : {
                        key1 : 'value1',
                        key2 : 'value2',
                        key3 : 'value3'
                    },
                    load : function(data) {
                        dojo.byId('mainDiv').innerHTML = data;
                    },
                    error : function(error) {
                      targetNode.innerHTML = "An unexpected error occurred: " + error;
                    }
                }
                var deferred = dojo.xhrGet(xhrArgs);
            });
        </script>


    </head>
    <body class="tundra">
        <div id="mainDiv">

        </div>
    </body>
</html>